using UnityEngine;
using System.Collections;

public class exitMenu : MonoBehaviour {
    public Rect exitWindow = new Rect(0, 0, 100, 100);
    public bool exitWindowButton = true;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
    void OnGUI()
    {
        GUI.Label(new Rect(200, 200, 500, 500), "This is the game Scene");
       if (Input.GetKey(KeyCode.Escape))
       {
           exitWindowButton = true;
            if (exitWindowButton)
            {
                GUI.Window(0, exitWindow, exitWindowMenu, "Exit Menu");
            }
       }
            

    }

    void exitWindowMenu(int windowID)
    {
        if(GUI.Button(new Rect(10,10,50,25),"Yes"))
        {
            Application.LoadLevel(0);
        }

        if (GUI.Button(new Rect(10, 50, 50,25), "No"))
       {
           exitWindowButton = false;
       }
        
    }
}
